package com.nnnu.wsnackshop.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.math.BigDecimal;

@Data
@Schema(description = "新增用户收货地址 DTO")
public class AddAddressDTO {
    @Schema(description = "用户 ID")
    private Integer userId;

    @NotBlank
    @Schema(description = "收件人/联系人", example = "张三", requiredMode = Schema.RequiredMode.REQUIRED)
    private String recipient;

    @NotBlank
    @Pattern(regexp = "^\\+?\\d{7,20}$")
    @Schema(description = "联系电话", example = "13800000000", requiredMode = Schema.RequiredMode.REQUIRED)
    private String phone;

    @NotBlank
    @Schema(description = "省", example = "北京市", requiredMode = Schema.RequiredMode.REQUIRED)
    private String province;

    @NotBlank
    @Schema(description = "市", example = "北京市", requiredMode = Schema.RequiredMode.REQUIRED)
    private String city;

    @NotBlank
    @Schema(description = "区", example = "朝阳区", requiredMode = Schema.RequiredMode.REQUIRED)
    private String district;

    @NotBlank
    @Schema(description = "详细地址", example = "望京SOHO", requiredMode = Schema.RequiredMode.REQUIRED)
    private String detail;

    @Schema(description = "纬度")
    private BigDecimal latitude;

    @Schema(description = "经度")
    private BigDecimal longitude;

    @Schema(description = "地址标签", example = "家")
    private String label;

    @Schema(description = "是否默认地址", example = "0")
    private Integer isDefault;
}
